feat(UI): added comment/title update API#1234
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR standardizes comment payloads, adds APIs for editing/deleting comments and MR/issue titles, and updates client hooks to use the new endpoints.
- Replaced multiple
SaveCommentRequesttypes with a singleContentPayload - Added
edit_comment,delete_comment,edit_titleendpoints and corresponding storage methods - Updated React Query hooks to use
ContentPayloadand the new conversation-based routes
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| moon/packages/types/generated.ts | Introduced ContentPayload, removed SaveCommentRequest, added new response types |
| moon/apps/web/hooks/usePostMrComment.ts | Switched hook to use ContentPayload |
| moon/apps/web/hooks/useDeleteMrCommentDelete.ts | Updated hook to call deleteApiConversationByCommentId |
| moon/apps/web/hooks/issues/usePostIssueComment.ts | Swapped in ContentPayload for issue comment hook |
| moon/apps/web/hooks/issues/useDeleteIssueComment.ts | Pointed delete hook at conversation delete endpoint |
| mono/src/api/mr/mr_router.rs | Replaced request bodies, removed old delete, added MR edit_title route |
| mono/src/api/issue/issue_router.rs | Ditto for issues: removed delete, added edit_title route |
| mono/src/api/conversation/mod.rs | Renamed SaveCommentRequest to ContentPayload |
| mono/src/api/conversation/conv_router.rs | Added delete_comment and edit_comment routes |
| jupiter/src/storage/mr_storage.rs | Implemented edit_title in MR storage |
| jupiter/src/storage/issue_storage.rs | Implemented edit_title in issue storage |
| jupiter/src/storage/conversation_storage.rs | Added update_comment in conversation storage |
| moon/api/lib/demo_orgs/data/notes.json | Large formatting changes in seed data |
| moon/api/lib/demo_orgs/data/calls.json | Large formatting changes in seed data |
Comments suppressed due to low confidence (6)
mono/src/api/issue/issue_router.rs:252
- Grammar nit: change "a Issue" to "an Issue" for clarity.
("link", description = "A string ID representing a Issue"),
mono/src/api/issue/issue_router.rs:249
- [nitpick] The
edit_titlepath is missing a@summaryannotation. Adding one (e.g.,@summary Edit issue title) will keep documentation consistent.
#[utoipa::path(
mono/src/api/conversation/conv_router.rs:101
- [nitpick] The
edit_commentroute lacks a@summaryannotation. Consider adding@summary Edit commentfor consistent generated docs.
#[utoipa::path(
moon/apps/web/hooks/useDeleteMrCommentDelete.ts:5
- [nitpick] The hook name
useDeleteMrCommentDeleteno longer matches the underlyingdeleteApiConversationByCommentIdendpoint. Consider renaming touseDeleteCommentoruseDeleteConversationComment.
export function useDeleteMrCommentDelete(id: string, params?: RequestParams) {
jupiter/src/storage/mr_storage.rs:184
- No tests accompany the new
edit_titlemethod. Adding unit or integration tests for title updates would improve confidence.
pub async fn edit_title(&self, link: &str, title: &str) -> Result<(), MegaError> {
moon/api/lib/demo_orgs/data/notes.json:1
- [nitpick] These massive seed‐data formatting changes seem unrelated to the API work and clutter the diff. Consider separating or reverting them to keep this PR focused.
[{"title":"2024 Park Plan","description_html":"<p>Welcome to the collaborative document for the <strong>2024 Park Plan!</strong> This document is intended to outline\n our strategies, initiatives, and milestones for the upcoming year.</p>\n<h1>Table of Contents</h1>\n<ol>\n <li>\n <p>Introduction</p>\n </li>\n <li>\n <p>Key Objectives</p>\n </li>\n <li>\n <p>Project Proposals</p>\n </li>\n <li>\n <p>Budget Overview</p>\n </li>\n <li>\n <p>Timeline</p>\n </li>\n</ol>\n<div data-hr-wrapper>\n <hr>\n</div>\n<h2>Introduction</h2>\n<p>Frontier Park is dedicated to <em>preserving natural beauty and providing an exceptional experience to all\n visitors</em>. As we move into 2024, we must focus on sustainability and innovation.</p>\n<h3>Our Mission</h3>\n<blockquote>\n <p>To protect the park's natural resources while fostering an environment that allows visitors to enjoy and learn\n from the wilderness.</p>\n</blockquote>\n<h3>Vision for 2024</h3>\n<p>Our vision is to make Frontier Park a model for conservation and visitor engagement, setting a benchmark for parks\n nationwide.</p>\n<h2>Key Objectives</h2>\n<ul>\n <li>\n <p><strong>Sustainability</strong>: Implement eco-friendly practices park-wide.</p>\n </li>\n <li>\n <p><strong>Education</strong>: Enhance visitor knowledge and appreciation of the natural world.</p>\n </li>\n <li>\n <p><strong>Community Engagement</strong>: Strengthen relationships with local communities and stakeholders.</p>\n </li>\n <li>\n <p><strong>Safety & Infrastructure</strong>: Ensure a safe and accessible environment for all.</p>\n </li>\n</ul>\n<h2>Project Proposals</h2>\n<ul>\n <li>\n <p>Eco-Lodges: Sustainable accommodation for visitors.</p>\n <ul>\n <li>\n <p>Restrooms</p>\n </li>\n <li>\n <p><a class=\"prose-link\" target=\"_blank\" href=\"https://campsite.com\"><span>Campsites</span></a></p>\n </li>\n <li>\n <p>Overnight accommodations</p>\n </li>\n </ul>\n </li>\n <li>\n <p>Interactive Exhibits: Using technology to educate visitors about wildlife.</p>\n </li>\n</ul>\n<h2>Budget Overview</h2>\n<p>Here is a brief overview of the proposed budget:</p>\n<ul>\n <li>\n <p><strong>Operations</strong>: $500,000</p>\n </li>\n <li>\n <p><strong>Conservation Projects</strong>: $350,000</p>\n </li>\n <li>\n <p><strong>Marketing & Outreach</strong>: $150,000</p>\n </li>\n <li>\n <p><strong>Facility Upgrades</strong>: <s>$200,000</s> $100,000</p>\n </li>\n</ul>\n<h2>Timeline</h2>\n<details class=\"details\">\n <summary>Q1: Research and Development</summary>\n <div data-type=\"detailsContent\">\n <p>In the first quarter of the year, the focus will be on conducting surveys to gather visitor feedback, analyzing\n biodiversity data, and exploring innovative ways to enhance visitor experiences. Additionally, research will be\n carried out to identify potential conservation initiatives and sustainability projects for the park.</p>\n </div>\n</details>\n<details class=\"details\">\n <summary>Q2: Implementation of Pilot Programs</summary>\n <div data-type=\"detailsContent\">\n <p>During the second quarter, pilot programs will be implemented to test new visitor engagement activities,\n conservation practices, and sustainable infrastructure initiatives within the park.</p>\n <p>These pilot programs aim to assess their feasibility, effectiveness, and impact on enhancing the overall visitor\n experience and environmental conservation efforts.</p>\n </div>\n</details>\n<details class=\"details\">\n <summary>Q3: Review & Adjustments</summary>\n <div data-type=\"detailsContent\">\n <p>In the third quarter, a comprehensive review of the pilot programs will be conducted to" evaluate their\n outcomes, gather stakeholder feedback, and assess any necessary adjustments for optimization.</p>\n <p>This phase involves:</p>\n <ul>\n <li>\n <p>Analyzing data</p>\n </li>\n <li>\n <p>Identifying strengths and areas for improvement</p>\n </li>\n <li>\n <p>Making strategic adjustments to ensure the success and sustainability of the initiatives.</p>\n </li>\n </ul>\n </div>\n</details>\n<details class=\"details\">\n <summary>Q4: Full-Scale Rollout</summary>\n <div data-type=\"detailsContent\">\n <p>During the fourth quarter, the full-scale rollout of successful pilot programs and initiatives will take place\n across the park. This phase involves expanding and implementing the refined strategies, integrating feedback from\n the review phase, and ensuring seamless execution of planned activities to maximize visitor engagement,\n conservation efforts, and sustainable practices park-wide.</p>\n </div>\n</details>\n<h2>Communication Guidelines</h2>\n<p>Please adhere to the following when posting in our <strong>Frontier Park Spaces</strong>:</p>\n<ul>\n <li>\n <p><strong>Be respectful and constructive.</strong></p>\n </li>\n <li>\n <p>Use proper grammar and punctuation.</p>\n </li>\n <li>\n <p><em>Stay on topic in each Space.</em></p>\n </li>\n</ul>\n<h3>Updates & Progress</h3>\n<ul>\n <li>\n <p><strong>Visitor Center Renovation</strong>: In progress, on track for Q2 completion.</p>\n </li>\n <li>\n <p><em>New Trails Campaign</em>: <s>Starting in April</s> <strong>Now starting in May</strong>.</p>\n </li>\n</ul>\n<h3>Technical Notes</h3>\n<p>For those working on the new mobile app, here's a snippet of the code to integrate the park map:</p>\n<pre><code class=\"language-javascript\">const mapOptions = {\\n center: { lat: 44.58, lng: -110.5 },\\n zoom: 8,\\n};\\n\\nfunction initMap() {\\n const parkMap = new google.maps.Map(document.getElementById('map'), mapOptions);\\n}</code></pre>\n<p>This code block initializes the map with predefined <code>mapOptions</code>.</p>\n<div data-hr-wrapper>\n <hr>\n</div>\n<p>Let's work together to make 2024 a milestone year for Frontier Park! 🌲</p>","public_visibility":false,"project":"General","project_permission":"view","member":"Ranger Rick","description_schema_version":4}]
genedna
enabled auto-merge
July 15, 2025 13:24
genedna
approved these changes
Jul 15, 2025
liuyangjuncong20202570
pushed a commit
to liuyangjuncong20202570/mega
that referenced
this pull request
Jul 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.